<template>
    <div class="card-wrap flex-column justify-end card-padding">
        <table-page :loading="loading" :dataList="dataList" :total="total" :page.sync="queryParam.pageNum"
                    :limit.sync="queryParam.pageSize" @setSizeCurrent="getList" border>

            <template slot="tableCol">
                <el-table-column
                    align="center"
                    type="index"
                    min-width="80"
                    label="序号">
                </el-table-column>

                <el-table-column
                    prop="approvalStatus"
                    label="调拨状态"
                    align="center"
                    show-overflow-tooltip
                    min-width="180">
                    <!--                    审批状态 0.待审批，1.审批中，2已完成，3审批拒绝-->
<!--                  bug15585  修改为调拨中-->
                    <template v-slot="{row}">
                        {{0==row.approvalStatus?'调拨中':
                            1==row.approvalStatus?'调拨中':
                            2==row.approvalStatus?'已完成':
                            3==row.approvalStatus?'已拒绝':
                            4==row.approvalStatus?'已驳回':'--'
                        }}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="allocationReason"
                    align="center"
                    show-overflow-tooltip
                    min-width="180"
                    label="调拨原因">
                    <template v-slot="{row}">
                        {{row.allocationReason|filterNull}}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="allocationOutName"
                    align="center"
                    show-overflow-tooltip
                    min-width="180"
                    label="调出车辆归属公司">
                    <template v-slot="{row}">
                        {{row.allocationOutName|filterNull}}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="allocationInName"
                    align="center"
                    show-overflow-tooltip
                    min-width="220"
                    label="调入车辆归属公司">
                    <template v-slot="{row}">
                        {{row.allocationInName|filterNull}}
                    </template>
                </el-table-column>
                <el-table-column
                    prop="approvalFinishedTime"
                    align="center"
                    show-overflow-tooltip
                    min-width="180"
                    label="调拨结束时间">
                    <template v-slot="{row}">
                        {{row.approvalFinishedTime|filterNull}}
                    </template>
                </el-table-column>

            </template>
        </table-page>

    </div>
</template>

<script>
import {listByCarId} from "@/api/zcwh/allocate";

export default {
    props: ['carId'],
    data() {
        return {
            dataList: [],
            loading: false,
            queryParam:{
                pageNum: 1,
                pageSize: 10,
            },
            total:0,
        };
    },
    created() {
        this.getList();
    },
    mounted() {
    },
    methods: {
        async getList() {
            this.loading = true;
            this.queryParam.carId = this.carId
            listByCarId(this.queryParam).then(res=>{
                this.dataList = res.rows
                this.total = res.total
                this.loading = false;
            }).finally(f=>{
                this.loading = false;
            })

        },

    },
};
</script>

<style scoped lang="scss">
.el-form {
    .box-card {
        font-size: 14px;
        margin-bottom: 20px;
    }
}
</style>


